#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:6031)

#include <stdio.h>

int main()
{
	char prisoner[4] = { 'A','B','C','D' };
	int i = 0;
	int result = 0;
	for (i = 0; i < 4; i++)
	{
		result = 0;
		if (prisoner[i] != 'A')
			result++;
		if (prisoner[i] == 'C')
			result++;
		if (prisoner[i] == 'D')
			result++;
		if (prisoner[i] != 'D')
			result++;
		if (3 == result)
		{
			printf("%c", prisoner[i]);
			break;
		}

	}

	return 0;
}